package cn.itcast.jd.controller;

import cn.itcast.jd.pojo.Item;
import cn.itcast.jd.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Administrator on 2019/8/5.
 */
@RestController
@CrossOrigin
@RequestMapping("/Item")
public class ItemController {

    @Autowired
    ItemService itemService;



    @RequestMapping(method = RequestMethod.POST)
    public void add(@RequestBody Item item){

        itemService.save(item);

        System.out.println("添加数据成功");

    }
}
